<template>
  <div>
    <h3>门店销售额排名</h3>
    <ul class="ranking">
      <li v-for="(item,index) in shopText" :key="index" class="rankingItem">
        <span>{{ item.no }}</span>
        <span>{{ item.name }}</span>
        <span>{{ item.money }}</span>
      </li>

    </ul>
  </div>
</template>

<script>
import { mapState } from 'vuex'

export default {
  name: 'Index',
  computed: {
    ...mapState({
      shopText: state => state.home.echartsinfo.userRank
    })
  }
}
</script>

<style scoped>
.ranking{
  list-style: none;
}
.rankingItem{
  display: flex;
  justify-content: space-between;
}
.ranking .rankingItem span{
  margin-right: 20px;
  margin-top: 10px;
  font-size: 16px;
}
.ranking .rankingItem span:nth-child(1){
  display: inline-block;
  text-align: center;
  width: 20px;
  height: 20px;
  line-height: 1.2rem;
}
.ranking .rankingItem:nth-child(1) span:nth-child(1){
  background-color: black;
  border-radius: 50%;
  color: #f4f4f5;
}
.ranking .rankingItem:nth-child(2) span:nth-child(1){
  background-color: black;
  border-radius: 50%;
  color: #f4f4f5;
}
.ranking .rankingItem:nth-child(3) span:nth-child(1){
  background-color: black;
  border-radius: 50%;
  color: #f4f4f5;
}
.ranking .rankingItem:nth-child(1) span:nth-child(2){
  font-weight: bold;
}
.ranking .rankingItem:nth-child(2) span:nth-child(2){
  font-weight: bold;
}
.ranking .rankingItem:nth-child(3) span:nth-child(2){
  font-weight: bold;
}
</style>
